/*
 * @Author: actor
 * @Date: 2023-11-13 15:44:38
 * @email: 395593455@qq.com
 * @LastEditors: actor
 * @LastEditTime: 2023-12-21 10:45:00
 * @FilePath: \i-hos-app\shared\emr\src\store\paperSet.ts
 * @Description: 纸张配置仓库数据
 */
// 引入pinia
import { defineStore } from 'pinia'
import { Names } from './Name'

// 配置类型约束
import { ISetPaperState } from '../interface/set'

// 创建配置数据仓库
export const usePaperSetStore = defineStore(Names.PaperSet, {
  state: (): ISetPaperState => {
    return {
      // 控制页面纸张设置弹层
      _paper_visible: false,
      // 页面纸张的参数默认值及保存修改纸张的参数值
      _emr_paper_set: {
        _n: 'A4',
        _w: 210,
        _h: 297,
        _orien_n: '纵向',
        _orien: 1,
        _e_n: '窄',
        _e: 12.7,
        _t_e: 12.7,
        _b_e: 12.7,
        _r_e: 12.7,
        _l_e: 12.7,
      },
      // 页面纸张设置参数
      _emr_paper_config: {
        _pd: [
          { _label: 1, _val: '纵向' },
          { _label: 2, _val: '横向' },
        ],
        _ps: [
          { _label: 'A4', _val: 'A4', _w: 210, _h: 297 },
          { _label: 'A3', _val: 'A3', _w: 297, _h: 420 },
          { _label: 'A5', _val: 'A5', _w: 148, _h: 210 },
          { _label: 'B3', _val: 'B3', _w: 260, _h: 370 },
          { _label: 'B4', _val: 'B4', _w: 185, _h: 260 },
          { _label: 'B5', _val: 'B5', _w: 130, _h: 185 },
        ],
        _pm: [
          { _label: '自定义', _val: '自定义', _w: '', _h: '' },
          { _label: '常规', _val: '常规', _w: 25.4, _h: 31.8 },
          { _label: '窄', _val: '窄', _w: 12.7, _h: 12.7 },
          { _label: '中等', _val: '中等', _w: 25.4, _h: 19.1 },
          { _label: '宽', _val: '宽', _w: 25.4, _h: 50.8 },
        ],
      },
    }
  },
})
